@@ -61,7 +61,13 @@ module Agents |
||
61 | 61 |
issues = get_issues(last_run) |
62 | 62 |
|
63 | 63 |
issues.each do |issue| |
64 |
- create_event :payload => issue |
|
64 |
+ updated = Time.parse(issue['fields']['updated']) |
|
65 |
+ |
|
66 |
+ # this check is more precise than in get_issues() |
|
67 |
+ # see get_issues() for explanation |
|
68 |
+ if updated > last_run then |
|
69 |
+ create_event :payload => issue |
|
70 |
+ end |
|
65 | 71 |
end |
66 | 72 |
|
67 | 73 |
memory[:last_run] = current_run |
@@ -90,13 +96,20 @@ module Agents |
||
90 | 96 |
startAt = 0 |
91 | 97 |
issues = [] |
92 | 98 |
|
99 |
+ # JQL doesn't have an ability to specify timezones |
|
100 |
+ # Because of this we have to fetch issues 24 h |
|
101 |
+ # earlier and filter out unnecessary ones at a later |
|
102 |
+ # stage. Fortunately, the 'updated' field has GMT |
|
103 |
+ # offset |
|
104 |
+ since -= 24*60*60 |
|
105 |
+ |
|
93 | 106 |
jql = "" |
94 | 107 |
|
95 | 108 |
if !options[:jql].empty? && since then |
96 | 109 |
jql = "(#{options[:jql]}) and updated >= '#{since.strftime('%Y-%m-%d %H:%M')}'" |
97 | 110 |
else |
98 | 111 |
jql = options[:jql] if !options[:jql].empty? |
99 |
- jql = "updatedd >= '#{since.strftime('%Y-%m-%d %H:%M')}'" if since |
|
112 |
+ jql = "updated >= '#{since.strftime('%Y-%m-%d %H:%M')} GMT'" if since |
|
100 | 113 |
end |
101 | 114 |
|
102 | 115 |
|